package com.esfak47.mediafetcher.app.controller;

import com.esfak47.common.Result;
import com.esfak47.mediafetcher.app.dto.mock.InfoRes;
import com.esfak47.mediafetcher.app.dto.mock.LoginRes;
import com.esfak47.mediafetcher.app.service.MockupApi;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MockController {

    @Resource
    private MockupApi mockupApi;

    @PostMapping(value = "/user/login")
    public Result<LoginRes> login(/*@RequestParam String username, @RequestParam String password*/) {
        //Result<Map> result = Result.getFromAsync(mockupApi.login(new MockupApi.UserBean(username, password)));
        return Result.success(new LoginRes());
    }

    @RequestMapping(value = "/user/logout")
    public Result<Void> logout(/*@RequestParam String username, @RequestParam String password*/) {
        //Result<Map> result = Result.getFromAsync(mockupApi.login(new MockupApi.UserBean(username, password)));
        return Result.success();
    }

    @RequestMapping(value = "/user/info")
    public Result<InfoRes> info() {
        //Result<Map> result = Result.getFromAsync(mockupApi.login(new MockupApi.UserBean(username, password)));
        return Result.success(new InfoRes());
    }
}
